-- bonfire
-- created by huanghr
-- 地牢格子：篝火堆

return {
    restoreGrid = function(grid, info)
        -- 还原次数
        if type(info["rummage_times"]) == "number" then
            grid.rummage_times = info["rummage_times"];
        end

        -- 还原次数
        if type(info["torch"]) == "number" then
            grid.torch = info["torch"];
        end

        -- 还原是否已经被点燃
        if type(info["lighted"] == "number") then
            grid.lighted = info["lighted"];
        end
    end,

    -- 收集上下文
    collectContext = function(grid)
        -- 收集已使用次数
        return { ["rummage_times"] = grid.rummage_times or 0, ["torch"] = grid.torch or 0, ["lighted"] = grid.lighted};
    end
};
